Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pruntime: Detect checkpoint breaking changes in unittest #1381

Merged
merged 3 commits into from
Sep 20, 2023

Conversation

kvinwang
Copy link
Collaborator

This PR adds #[derive(TypeInfo)] onto the pruntime checkpoint data types and dump the type tree in unittest.
Ideally, it would trigger a test failure once there are some changes in the type tree.
However, it is not 100% accurate, becuase the different behaivor between serde and TypeInfo. For example, TypeInfo always skips zero sized types but serde doesn't.

Copy link
Contributor

@h4x3rotab h4x3rotab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant idea. How do you come up with the TypeInfo idea? Also, codec(skip) is applied for most of the serde(skip) fields, but not all. How do you choose them?

@kvinwang
Copy link
Collaborator Author

Brilliant idea. How do you come up with the TypeInfo idea?

In PR #1363, a breaking change was introduced. I came up with this solution while troubleshooting the issue.

Also, codec(skip) is applied for most of the serde(skip) fields, but not all. How do you choose them?

The purpose of #[codec(skip)] is to skip fields that are hard to implement TypeInfo for; And our mind are aware of these fields would unlikely change.

Copy link
Contributor

@h4x3rotab h4x3rotab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kvinwang kvinwang merged commit 74687a0 into master Sep 20, 2023
8 checks passed
@kvinwang kvinwang deleted the check-cpt-type branch September 20, 2023 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants